From: Jonas Dreßler Date: Thu, 30 Jan 2020 10:27:25 +0000 (+0100) Subject: dialogs: Hide caps lock warning if password entry is hidden X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~63 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=45c5f21f6c3060101a58247290cea5f81c2b9a88;p=gnome-shell.git dialogs: Hide caps lock warning if password entry is hidden If all password entries in dialogs are hidden, there is either an entry that has visible characters or no entry at all. That means we don't have to show the caps lock warning at all, so hide it. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/942 --- diff --git a/js/ui/components/keyring.js b/js/ui/components/keyring.js index 46c61ace0..c0191fbba 100644 --- a/js/ui/components/keyring.js +++ b/js/ui/components/keyring.js @@ -59,6 +59,12 @@ class KeyringDialog extends ModalDialog.ModalDialog { let warningBox = new St.BoxLayout({ vertical: true }); let capsLockWarning = new ShellEntry.CapsLockWarning(); + let syncCapsLockWarningVisibility = () => { + capsLockWarning.visible = + this.prompt.password_visible || this.prompt.confirm_visible; + }; + this.prompt.connect('notify::password-visible', syncCapsLockWarningVisibility); + this.prompt.connect('notify::confirm-visible', syncCapsLockWarningVisibility); warningBox.add_child(capsLockWarning); let warning = new St.Label({ style_class: 'prompt-dialog-error-label' }); diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index 2e154ff99..4228cac4b 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -103,6 +103,9 @@ var AuthenticationDialog = GObject.registerClass({ let warningBox = new St.BoxLayout({ vertical: true }); let capsLockWarning = new ShellEntry.CapsLockWarning(); + this._passwordEntry.bind_property('visible', + capsLockWarning, 'visible', + GObject.BindingFlags.SYNC_CREATE); warningBox.add_child(capsLockWarning); this._errorMessageLabel = new St.Label({